#!/bin/bash
#========================================================================
# Author: YSLin
# Email: 
# File Name: jnipatch.sh
# Description: 
#     為了讓lunch 2的x86可以work要改得設定?
#     還未完成
#   
# Edit History: 
#   2010-11-26    File created.
#========================================================================


#In file included from /usr/include/fcntl.h:205,
#				 from frameworks/base/core/jni/android_server_Watchdog.cpp:21:
#In function ‘int open(const char*, int, ...)’,
#	inlined from ‘void dumpKernelStacks(JNIEnv*, _jobject*, _jstring*)’ at frameworks/base/core/jni/android_server_Watchdog.cpp:66:
#/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
#make: *** [out/debug/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/android_server_Watchdog.o] Error 1
#
#
#


#external/sqlite/android/OldPhoneNumberUtils.cpp: In function ‘int android::indexOf(const char*, char)’:
#external/sqlite/android/OldPhoneNumberUtils.cpp:176: error: invalid conversion from ‘const char*’ to ‘char*’
#make: *** [out/debug/host/linux-x86/pr/sim/obj/STATIC_LIBRARIES/libsqlite3_android_intermediates/OldPhoneNumberUtils.o] Error 1
#
#
#
#frameworks/base/media/libmedia/MediaScanner.cpp: In function ‘bool android::fileMatchesExtension(const char*, const char*)’:
#frameworks/base/media/libmedia/MediaScanner.cpp:80: error: invalid conversion from ‘const char*’ to ‘char*’
#frameworks/base/media/libmedia/MediaScanner.cpp:86: error: invalid conversion from ‘const char*’ to ‘char*’
#make: *** [out/debug/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libmedia_intermediates/MediaScanner.o] Error 1

#
#
#frameworks/base/media/libstagefright/HTTPDataSource.cpp: In constructor ‘android::HTTPDataSource::HTTPDataSource(const char*, const android::KeyedVector<android::String8, android::String8>*)’:
#frameworks/base/media/libstagefright/HTTPDataSource.cpp:161: error: invalid conversion from ‘const char*’ to ‘char*’
#frameworks/base/media/libstagefright/HTTPDataSource.cpp:170: error: invalid conversion from ‘const char*’ to ‘char*’
#make: *** [out/debug/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libstagefright_intermediates/HTTPDataSource.o] Error 1
#
#frameworks/base/opengl/libagl/egl.cpp:554: internal compiler error: in add_phi_arg, at tree-phinodes.c:391
#Please submit a full bug report,
#with preprocessed source if appropriate.
#See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
#make: *** [out/debug/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libGLES_android_intermediates/egl.o] Error 1

以上都是const char * 或const的問題

#host Executable: simulator (out/host/linux-x86/obj/EXECUTABLES/simulator_intermediates/simulator)
#out/host/linux-x86/obj/EXECUTABLES/simulator_intermediates/DeviceWindow.o: In function `DeviceWindow::OnUserEvent(UserEvent&)':
#/home/zod/mydroid_froyo32bitx86/development/simulator/app/DeviceWindow.cpp:175: undefined reference to `wxImage::HasAlpha() const'
#out/host/linux-x86/obj/EXECUTABLES/simulator_intermediates/MainFrame.o: In function `MainFrame::CreateDeviceMenu(char const*)':
#/home/zod/mydroid_froyo32bitx86/development/simulator/app/MainFrame.cpp:280: undefined reference to `wxMenuBase::AppendSeparator()'
#out/host/linux-x86/obj/EXECUTABLES/simulator_intermediates/MainFrame.o: In function `MainFrame::ConstructMenu()':
#/home/zod/mydroid_froyo32bitx86/development/simulator/app/MainFrame.cpp:239: undefined reference to `wxMenuBase::AppendSeparator()'
#collect2: ld returned 1 exit status
#make: *** [out/host/linux-x86/obj/EXECUTABLES/simulator_intermediates/simulator] Error 1


sudo apt-get install libwxgtk2.8-0
sudo apt-get install libwxbase2.8-dev libwxbase2.8-0

#
#

In file included from external/stlport/stlport/limits.h:30,
                 from external/stlport/stlport/climits:40,
                 from external/stlport/stlport/stl/_limits.h:28,
                 from external/stlport/stlport/limits:29,
                 from external/gtest/src/../include/gtest/gtest.h:64,
                 from external/gtest/src/../src/gtest.cc:34,
                 from external/gtest/src/gtest-all.cc:36:
/usr/include/../include/limits.h:125:26: error: no include path in which to search for limits.h
In file included from external/stlport/stlport/limits.h:30,
                 from external/gtest/src/../src/gtest-filepath.cc:48,
                 from external/gtest/src/gtest-all.cc:38:
/usr/include/../include/limits.h:125:26: error: no include path in which to search for limits.h
In file included from external/stlport/stlport/limits.h:30,
                 from external/gtest/src/../src/gtest-port.cc:34,
                 from external/gtest/src/gtest-all.cc:39:
/usr/include/../include/limits.h:125:26: error: no include path in which to search for limits.h
In file included from external/stlport/stlport/limits:29,
                 from external/gtest/src/../include/gtest/gtest.h:64,
                 from external/gtest/src/../src/gtest.cc:34,
                 from external/gtest/src/gtest-all.cc:36:
external/stlport/stlport/stl/_limits.h:124: error: ‘CHAR_BIT’ was not declared in this scope
In file included from external/stlport/stlport/limits:29,
                 from external/gtest/src/../include/gtest/gtest.h:64,
                 from external/gtest/src/../src/gtest.cc:34,
                 from external/gtest/src/gtest-all.cc:36:


In file included from external/gtest/src/gtest-all.cc:39:
external/gtest/src/../src/gtest-port.cc: In function ‘bool testing::internal::ParseInt32(const testing::Message&, const char*, testing::internal::Int32*)’:
external/gtest/src/../src/gtest-port.cc:591: error: ‘LONG_MAX’ was not declared in this scope
external/gtest/src/../src/gtest-port.cc:591: error: ‘LONG_MIN’ was not declared in this scope
In file included from external/stlport/stlport/stl/_num_put.h:180,
                 from external/stlport/stlport/stl/_ostream.c:26,
                 from external/stlport/stlport/stl/_ostream.h:380,
                 from external/stlport/stlport/stl/_istream.h:31,
                 from external/stlport/stlport/iostream:43,
                 from external/gtest/src/../include/gtest/internal/gtest-port.h:153,
                 from external/gtest/src/../include/gtest/internal/gtest-internal.h:40,
                 from external/gtest/src/../include/gtest/gtest.h:65,
                 from external/gtest/src/../src/gtest.cc:34,
                 from external/gtest/src/gtest-all.cc:36:
external/stlport/stlport/stl/_num_put.c: In function ‘char* std::priv::__write_integer_backward(char*, int, _Integer) [with _Integer = long int]’:
external/stlport/stlport/stl/_num_put.c:380:   instantiated from ‘_OutputIter std::priv::__do_put_integer(_OutputIter, std::ios_base&, _CharT, _Integer) [with _CharT = char, _OutputIter = std::ostreambuf_iterator<char, std::char_traits<char> >, _Integer = long int]’
external/stlport/stlport/stl/_num_put.c:434:   instantiated from ‘_OutputIter std::num_put<_CharT, _OutputIter>::do_put(_OutputIter, std::ios_base&, _CharT, long int) const [with _CharT = char, _OutputIter = std::ostreambuf_iterator<char, std::char_traits<char> >]’
external/stlport/stlport/stl/_num_put.h:67:   instantiated from ‘_OutputIter std::num_put<_CharT, _OutputIter>::put(_OutputIter, std::ios_base&, _CharT, long int) const [with _CharT = char, _OutputIter = std::ostreambuf_iterator<char, std::char_traits<char> >]’
external/stlport/stlport/stl/_ostream.c:202:   instantiated from ‘std::basic_ostream<_CharT, _Traits>& std::priv::__put_num(std::basic_ostream<_CharT, _Traits>&, _Number) [with _CharT = char, _Traits = std::char_traits<char>, _Number = long int]’
external/stlport/stlport/stl/_ostream.c:240:   instantiated from ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>]’
external/gtest/src/../include/gtest/internal/gtest-port.h:856:   instantiated from here
external/stlport/stlport/stl/_num_put.c:358: error: ‘is_signed’ is not a member of ‘std::numeric_limits<long int>’
make: *** [out/debug/host/linux-x86/pr/sim/obj/STATIC_LIBRARIES/libgtest_intermediates/gtest-all.o] Error 1

#solution
GCC trunk now has multiple internal headers directories, one
containing the self-contained GCC-provided headers and one containing the
<limits.h>

#Resetting g++ to point to g++-4.2, the package still builds fine.
 
#
